from Base import message, intersect, SS_VALID
from DRG import MDCP_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["31.3x03","31.7900x004","31.7900x005","45.9301","45.9303","49.9100","58.3905","58.5x00","58.5x01","59.0201","59.0202"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss and record.ageDay!=None and record.ageDay<29:
    message('符合PJ1入组条件，匹配规则：主手术匹配、新生儿')

    if MDCP_DRG.PJ19_group(record):
      return 'PJ19'
        
    return 'PJ1'
  else:
    return ''
    
